﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace markdown_picture_packer.frontend
{
    public abstract class BasePanel : Panel, IFront
    {
        public BasePanel()
        {
            InitComponent();
            InitSize(0, 0);
            InitLocation();
            InitEvent();
            AddComponent();
        }
        public abstract void InitComponent();
        public abstract void InitSize(int newWidth, int newHeight);
        public abstract void InitLocation();
        public virtual void InitEvent()
        {
            SizeChanged += (s, e) =>
            {
                InitSize(Width, Height);
                InitLocation();
            };
        }
        public abstract void AddComponent();
    }
}
